package com.els.pages.service;

import com.els.pages.fallBack.FeignServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @title: FeignClientService
 * @projectName fake-baidu
 * @Date: 2021/7/1 20:17
 * @Author: lei.yu-esint
 * @Description:
 */
@FeignClient(
        value = "search",
        fallbackFactory = FeignServiceFallback.class
)//熔断后调取本地方法,且有返回值

public interface FeignClientService {

    /**
     * 分页获取首页推荐新闻
     * @param pages
     * @param size
     * @return
     */
    @RequestMapping("/getIndexPushNews/{pages}/{size}")
    public String getIndexPushNews(@PathVariable String pages,@PathVariable String size);

    /**
     * 首页关键字查询
     * @param keyword
     * @return
     */
    @RequestMapping("/getIndexKeywords/{keyword}/{page}/{size}")
    public String getIndexKeywords(
            @PathVariable(value = "keyword") String keyword,
            @PathVariable(value = "page") String page,
            @PathVariable(value = "size") String size
    );

}
